<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="/WEB-INF/tlds/spring.tld"%>
<%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld"%>
<c:set var="BasePath" value="${pageContext.request.contextPath}"></c:set>
<c:set var="Plugins"
	value="${pageContext.request.contextPath}/res/plugins"></c:set>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>出库管理</title>
<link href="${Plugins}/ligerUI/skins/Aqua/css/ligerui-all.css"
	rel="stylesheet" type="text/css" />
<script src="${Plugins}/jquery/jquery-1.3.2.min.js"
	type="text/javascript"></script>
<link href="${Plugins}/ligerUI/skins/ligerui-icons.css" rel="stylesheet"
	type="text/css" />
<script src="${Plugins}/ligerUI/js/ligerui.min.js"
	type="text/javascript"></script>
<script src="${Plugins}/datepicker/WdatePicker.js"
	type="text/javascript"></script>
<script src="${Plugins}/dateUtil.js" type="text/javascript"></script>
<script type="text/javascript" src="${BasePath}/res/js/ligerCommon.js"></script>
<style type="text/css">
#searchbar {
	margin-bottom: 10px;
	margin-left: 15px;
}

.navbar {
	height: 20px;
	border-bottom: #E6E6E6 solid 1px;
	line-height: 20px;
}

.l-button-search {
	width: 50px;
	margin-left: 10px;
	padding-bottom: 2px;
	display: inline;
}

.inputSize {
	width: 150px;
}

select {
	width: 150px;
	font-size: 12px;
}

td {
	font-size: 12px
}

tr {
	height: 40
}
</style>
</head>
<body style="padding: 6px; overflow: hidden;">
	<div class="navbar">
		<span>您当前的位置：</span> 出入库管理 &gt; 库存变更记录&gt; 导出库存变更记录
	</div>

	<form id = "form1"
		action="${BasePath}/stockmanage/stockHistoryController/downloadStockHistory.do"
		method="post">
		<div id="searchbar">

			<br>
			<div>可选择以下筛选条件导出：</div>
			<table style="width: 100%" border=0>
				<tr>
					<td>出入库单号：</td>
					<td><input id="stockNo" name="stockNo" type="text"
						value="${stockHistory.stockNo}" class="inputSize" /></td>
				</tr>
				<tr>
					<td>出入库类型：</td>
					<td id="stockTypeTd"></td>
				</tr>
				<tr>
					<td>采购单号：</td>
					<td><input id="purNo" name="purNo" type="text"
						value="${stockHistory.purNo}" class="inputSize" /></td>
				</tr>
				<tr>
					<td>商品编号：</td>
					<td><input id="commoNo" name="commoNo" type="text"
						value="${stockHistory.commoNo}" class="inputSize" /></td>
				</tr>
				<tr>
					<td>商品名称：</td>
					<td><input id="commoName" name="commoName" type="text"
						value="${stockHistory.commoName}" class="inputSize" /></td>
				</tr>
				<tr>
					<td>仓库：</td>
					<td id="whTd"></td>
				</tr>
				<tr>
					<td>入库时间：</td>
					<td><input style="width: 150px" id="beginTimeShow" type="text" name="beginTimeShow" readonly="readonly"
						value="${stockHistory.beginTime}" class="Wdate" value="" size="21"
						onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,autoPickDate:true,maxDate:'#F{$dp.$D(\'endTime\')||\'2020-10-01\'}'})">
						&nbsp;至&nbsp; 
						<input style="width: 150px" id="endTimeShow" type="text" name="endTimeShow" readonly="readonly" value="${stockHistory.endTime}"
						class="Wdate" value="" size="21"
						onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,autoPickDate:true,minDate:'#F{$dp.$D(\'beginTime\')||\'2013-01-01\'}'})">
						<input name = "beginTime" id = "beginTime" type="hidden">
						<input name = "endTime" id = "endTime" type="hidden">
					</td>
				</tr>
				<tr>
					<td colspan="2" style="text-align: right;"><input
						type="button" id="resetBtn" value="导出" class="l-button-search"
						onclick="downloadStockHistory()" /> <input type="button"
						id="importBtn" value="取消" class="l-button-search"
						onclick="cancelStockHistory()" /></td>
				</tr>
			</table>
		</div>
	</form>

	<div id="dataGrid" style="margin: 0; padding: 0"></div>
	<script>
	initPage()
	function initPage(){
		$("#stockTypeTd").html(window.parent.$("#stockTypeTd").html())
		$("#whTd").html(window.parent.$("#whTd").html())
		var parms = window.parent.parms
		$("#stockNo").val(parms.stockNo);
		$("#stockType").val(parms.stockType);
		$("#whNo").val(parms.whNo);
		$("#commoName").val(parms.commoName);
		$("#purNo").val(parms.purNo);
		$("#commoNo").val(parms.commoNo);
		$("#beginTime").val(parms.beginTime);
		$("#endTime").val(parms.endTime) ;
		$("#beginTimeShow").val(parms.beginTime);
		$("#endTimeShow").val(parms.endTime) ;
	}
	function cancelStockHistory(){
		parent.$.ligerDialog.close();
		parent.$(".l-dialog,.l-window-mask").remove();
	}
    function downloadStockHistory(){
    	$("#beginTime").val(getFullTime($("#beginTimeShow").val(),true));
		$("#endTime").val(getFullTime($("#endTimeShow").val(),false)) ;
    	$('#form1').submit();
    	setTimeout("cancelStockHistory()",500)
    }
</script>
</body>
</html>